.class public Lcom/glympse/platform/Reflection$_MenuItem;
.super Ljava/lang/Object;
.source "Reflection.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/glympse/platform/Reflection;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x9
    name = "_MenuItem"
.end annotation


# static fields
.field private static ms_SHOW_AS_ACTION_IF_ROOM:I

.field private static ms_SHOW_AS_ACTION_WITH_TEXT:I

.field private static ms_fLoaded:Z

.field private static ms_oMethod_setShowAsAction:Ljava/lang/reflect/Method;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 320
    const/4 v0, 0x0

    sput-boolean v0, Lcom/glympse/platform/Reflection$_MenuItem;->ms_fLoaded:Z

    .line 321
    const/4 v0, 0x0

    sput-object v0, Lcom/glympse/platform/Reflection$_MenuItem;->ms_oMethod_setShowAsAction:Ljava/lang/reflect/Method;

    .line 322
    const/4 v0, 0x1

    sput v0, Lcom/glympse/platform/Reflection$_MenuItem;->ms_SHOW_AS_ACTION_IF_ROOM:I

    .line 323
    const/4 v0, 0x4

    sput v0, Lcom/glympse/platform/Reflection$_MenuItem;->ms_SHOW_AS_ACTION_WITH_TEXT:I

    .line 318
    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 318
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method private static Load()V
    .locals 5

    .prologue
    const/4 v1, 0x1

    .line 328
    sget-boolean v0, Lcom/glympse/platform/Reflection$_MenuItem;->ms_fLoaded:Z

    if-nez v0, :cond_0

    .line 330
    sput-boolean v1, Lcom/glympse/platform/Reflection$_MenuItem;->ms_fLoaded:Z

    .line 334
    :try_start_0
    const-class v0, Landroid/view/MenuItem;

    const-string v1, "setShowAsAction"

    const/4 v2, 0x1

    new-array v2, v2, [Ljava/lang/Class;

    const/4 v3, 0x0

    sget-object v4, Ljava/lang/Integer;->TYPE:Ljava/lang/Class;

    aput-object v4, v2, v3

    invoke-virtual {v0, v1, v2}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v0

    sput-object v0, Lcom/glympse/platform/Reflection$_MenuItem;->ms_oMethod_setShowAsAction:Ljava/lang/reflect/Method;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_2

    .line 340
    :goto_0
    sget-object v0, Lcom/glympse/platform/Reflection$_MenuItem;->ms_oMethod_setShowAsAction:Ljava/lang/reflect/Method;

    if-eqz v0, :cond_0

    .line 344
    :try_start_1
    const-class v0, Landroid/view/MenuItem;

    const-string v1, "SHOW_AS_ACTION_IF_ROOM"

    invoke-virtual {v0, v1}, Ljava/lang/Class;->getField(Ljava/lang/String;)Ljava/lang/reflect/Field;

    move-result-object v0

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Ljava/lang/reflect/Field;->getInt(Ljava/lang/Object;)I

    move-result v0

    sput v0, Lcom/glympse/platform/Reflection$_MenuItem;->ms_SHOW_AS_ACTION_IF_ROOM:I
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    .line 351
    :goto_1
    :try_start_2
    const-class v0, Landroid/view/MenuItem;

    const-string v1, "SHOW_AS_ACTION_WITH_TEXT"

    invoke-virtual {v0, v1}, Ljava/lang/Class;->getField(Ljava/lang/String;)Ljava/lang/reflect/Field;

    move-result-object v0

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Ljava/lang/reflect/Field;->getInt(Ljava/lang/Object;)I

    move-result v0

    sput v0, Lcom/glympse/platform/Reflection$_MenuItem;->ms_SHOW_AS_ACTION_WITH_TEXT:I
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    .line 358
    :cond_0
    :goto_2
    return-void

    .line 353
    :catch_0
    move-exception v0

    goto :goto_2

    .line 346
    :catch_1
    move-exception v0

    goto :goto_1

    .line 336
    :catch_2
    move-exception v0

    goto :goto_0
.end method

.method public static SHOW_AS_ACTION_IF_ROOM()I
    .locals 1

    .prologue
    .line 363
    invoke-static {}, Lcom/glympse/platform/Reflection$_MenuItem;->Load()V

    .line 364
    sget v0, Lcom/glympse/platform/Reflection$_MenuItem;->ms_SHOW_AS_ACTION_IF_ROOM:I

    return v0
.end method

.method public static SHOW_AS_ACTION_WITH_TEXT()I
    .locals 1

    .prologue
    .line 370
    invoke-static {}, Lcom/glympse/platform/Reflection$_MenuItem;->Load()V

    .line 371
    sget v0, Lcom/glympse/platform/Reflection$_MenuItem;->ms_SHOW_AS_ACTION_WITH_TEXT:I

    return v0
.end method

.method public static setShowAsAction(Landroid/view/MenuItem;I)V
    .locals 5
    .parameter "oMenuItem"
    .parameter "nActions"

    .prologue
    .line 377
    invoke-static {}, Lcom/glympse/platform/Reflection$_MenuItem;->Load()V

    .line 379
    sget-object v1, Lcom/glympse/platform/Reflection$_MenuItem;->ms_oMethod_setShowAsAction:Ljava/lang/reflect/Method;

    if-eqz v1, :cond_0

    .line 383
    :try_start_0
    sget-object v1, Lcom/glympse/platform/Reflection$_MenuItem;->ms_oMethod_setShowAsAction:Ljava/lang/reflect/Method;

    const/4 v2, 0x1

    new-array v2, v2, [Ljava/lang/Object;

    const/4 v3, 0x0

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    aput-object v4, v2, v3

    invoke-virtual {v1, p0, v2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 390
    :cond_0
    :goto_0
    return-void

    .line 385
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 387
    .local v0, e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_0
.end method
